FileOpenLPT

 

The 'FileOpenLPT' function opens the specified print port.

 

DWORD FileOpenLPT(string lpt);

 

Note : Only if a print port is opened, you can write data to the print port. In other words, only if you use the 'FileOpenLPT' function, you can use the 'FileWrite' function to write data to the print port. Also, after you finish your use of the print port, you must always close the print port. In other words, after you use the 'FileOpenLPT' function, you must always use the 'FileClose' function.

 

Parameters

string lpt : print port that you want to open / (ex) LPT1, LPT2

 

Return Value

condition of the print port (0 = The print port is not opened, 1 or higher = The print port is opened)

When 'Return Value' is '0', the probable reason is as follows : The print port doesn't exist. / Another program is using the print port.

 

Example

handle  = @FileOpenLPT("LPT1");

if(handle != 0)

{

@FileWrite(handle, "example data", 12);

@FileClose(handle);

}

Description : The first line is to open the print port named 'LPT1'. If the file is opened, 'example data' is written to the print port. Afterward, the print port is closed by the '@FileClose(handle);'.